/*
 * NeuroAuto.hh
 *
 *  Created on: Jan 28, 2009
 *      Author: robotics
 */
#ifndef NEUROAUTO_H_
#define NEUROAUTO_H_

#include <iostream.h>
#include "math.h"

#include "AxisCamera.h" 
#include "BaeUtilities.h"
#include "FrcError.h"
#include "TrackAPI.h" 
#include "WPILib.h"
#include "RobodoxTimer.h"
#include "RobodoxJaguar.h"

/*
 * Description: Autonomous code for Robodox 2009 FRC robot, the Neurologist
 */
class NeuroAuto{
	
public:
	static const float gearRatio = 12.5;			//Andy Mark toughbox ratio
	static const float Ke = 0.021142234;						//CIM-001 Motor back EMF constant in volts/(radian/second)
	float v_robot;
	/*
	 * Default constructor
	 */
	NeuroAuto();
	NeuroAuto(RobodoxJaguar *l, RobodoxJaguar *r, Encoder *lg, Encoder *rg, Encoder *rref, Encoder *lref, RobodoxTimer *rt, Gyro *g); //YAP: took out Encoder lr/rr
	
	
	void TractionControl();
	void RandomDrive();
	float randRange(float min, float max);
	void CenterCircling();
	void CornerCircling();
	void AroundDrive(int position);
	void GoForward(int inches);
	void GoForward(double tim);
	void Turn(int degrees);
	void Stop();
	
	/*
	 * Default destructor
	 */
	~NeuroAuto();

private:
	
	RobodoxJaguar *leftMotor;
	RobodoxJaguar *rightMotor;
	
	Encoder *leftGearbox;
	Encoder *rightGearbox;
	Encoder *rightRef;
	Encoder *leftRef;
	
	RobodoxTimer *time;
	
	Gyro *g1;
	
	float sum;
	float *timeArray;
	float *speedArray;
	int arrayLength;
	int i, autoIndex;
	bool begin;
};

#endif
